<?php

//require_once("lib/template/class.template.form.php");

class FormRecovery extends Application {

    private $mForm;
    private $mData;
    private $mErrorSection;
    private $mErrorCode;

    public function __construct($pData) {
        $this->mData= $pData;
    }
    
    public function PrintForm() {
        $tForm['FormName'] = 'formRollback';
        $tForm['FormMethod'] = 'post';

        $this->mForm = new FormTemplate($tForm);
        $this->mForm->SetFormTargetAction($_POST["HTTP_REFERER"]);

        if (is_array($this->mData)) {
            $i = 0;
            $this->mForm->SetType('hidden', $i);
            $this->mForm->SetName("ERROR_SECTION", $i);
            $this->mForm->SetValue($this->mErrorSection, $i);
            $i++;
            $this->mForm->SetType('hidden', $i);
            $this->mForm->SetName("ERROR_CODE", $i);
            $this->mForm->SetValue($this->mErrorCode, $i);
            $i++;
            
            foreach ($this->mData as $tKey => $tValue) {
                $this->mForm->SetType('hidden', $i);
                $this->mForm->SetName($tKey, $i);
                $this->mForm->SetValue($tValue, $i);
                $i++;
            }


            $this->mForm->PrintForm();
        } else {
            //ERROR
        }
    }
    
    
    public function SetErrorSection($pValue){
        $this->mErrorSection= $pValue;
    }
    
    public function SetErrorCode($pValue){
        $this->mErrorCode= $pValue;
    }

    public function GetErrorSection(){
        return $this->mErrorSection;
    }
    
    public function GetErrorCode(){
       return  $this->mErrorCode;
    }
}

?>